const { exec } = require('child_process');
const { stderr } = require('process');


module.exports = {
    cmdApi: {
        execCmd: (commandArray)=> {

            const { spawn,exec } = require('child_process');

            // 依次执行输入框中的命令
            for(let i in commandArray) {

                try{
                    exec(commandArray[i])
                    
                }catch (e){
                    console.log(e, '出错了!')
                }
                finally{
                    console.log("命令执行完成!")
                }
            }
        }
    }

}
